APP_NAME=mqtt

PRJ_PATH=$(shell pwd)
LIBS_PATH=${PRJ_PATH}/3rdlib/install

#compile falgs
CFLAGS  = -I ${LIBS_PATH}/include

#ld(links) falgs
LDFLAGS  = -L ${LIBS_PATH}/lib
LDFLAGS += -lmosquitto  -lcjson -liniparser -lzlog -lsqlite3


all: libs

	gcc ${CFLAGS} *.c  -o ${APP_NAME} ${LDFLAGS}

libs:
	make -C 3rdlib

clean:
	rm -f  ${APP_NAME}
	rm -f *.o
	rm -f *.i
	rm -rf *.db
	rm -f *.log
	make clean -C 3rdlib

distclean: clean
	make distclean -C 3rdlib
